package com.example.fishscavengerhunt;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;
import android.widget.SpinnerAdapter;

public class ImageAdapter extends BaseAdapter implements SpinnerAdapter {
	
	private Context context;

	public ImageAdapter(Context context){
		this.context = context;
	}
	public int getCount() {
		// TODO Auto-generated method stub
		return ThumbsIds.length;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup arg2) {
		// TODO Auto-generated method stub
		ImageView imageView=null;
		if(convertView==null){
			imageView= new ImageView(context);
			imageView.setLayoutParams(new Gallery.LayoutParams(250, 100));
			imageView.setPadding(8, 8, 8, 8);
		} else {
			imageView = (ImageView) convertView;
		}
		imageView.setImageResource(ThumbsIds[position]);
		return imageView;
	}
	
	public static Integer[] ThumbsIds ={
		R.drawable.coldwater,
		R.drawable.gaexplorer,
		R.drawable.oceanvoyager,
		R.drawable.riverscout,
		R.drawable.tropicaldiver
	};

}
